package com.wing.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.common.model.entity.Contract;
import com.wing.common.model.entity.ContractChangeRecord;
import com.wing.common.model.response.ContractChangeRecordVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 合同变更记录-Dao
 *
 * @author
 */
@Mapper
public interface ContractChangeRecordDao extends BaseMapper<ContractChangeRecord> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<ContractChangeRecordVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<ContractChangeRecordVO> list4app(@Param("page") Page<ContractChangeRecordVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    ContractChangeRecordVO get4appById(Long id);

    /**
     * 修改合同状态
     * @param contractId
     */
    void updateContractStatus(@Param("contractId") Long contractId);

    /**
     * 获取合同数据
     * @param contractId
     * @return
     */
    @Select("select * from com_contract where id = #{contractId}")
    Contract getContract(Long contractId);
}
